package com.io.mq;

import com.io.dto.ProductReq;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * The class/interface
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "my-producer-group", topic = "base-order")
public class MqService implements RocketMQListener<ProductReq> {
    @Override
    public void onMessage(ProductReq productReq) {
        log.info("接收一个订单信息：[{}]", productReq);
    }
}
